﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AfterlifeEditor.Forms
{
    public partial class NewLevelForm : Form
    {
        public NewLevelForm()
        {
            InitializeComponent();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(widthTextBox.Text) ||
                string.IsNullOrEmpty(heightTextBox.Text))
                return;

            if (int.Parse(widthTextBox.Text) <= 0 ||
                int.Parse(heightTextBox.Text) <= 0)
                return;

            DialogResult = DialogResult.OK;
            Close();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}
